package com.bytz.modules.cms.statistic.model;

import com.bytz.modules.cms.statistic.enums.IntervalType;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class TurnoverRequest {

    @JsonIgnore
    private IntervalType interval;

    @ApiModelProperty(value = "时间间隔", notes = "YEARS, HALF_YEARS, QUARTERS, MONTHS, WEEKS, DAYS")
    private String intervalStr;

    @ApiModelProperty("开始时间")
    private LocalDateTime start;

    @ApiModelProperty("结束时间")
    private LocalDateTime end;

    public IntervalType getInterval() {
        return IntervalType.operatorOf(intervalStr);
    }
}
